/*
 * Copyright (c) JoinQuant Development Team
 * Author: Huayong Kuang <kuanghuayong@joinquant.com>
 *
 */

#include <iostream>

using namespace std;

struct TData {
    char name[32];
    char country[16];
    int age;

    TData()
        :name{0}
        , country{0}
        , age(-1)
    {}
};

int main(void)
{
    TData t1;
    TData t2;

    char name[] = "Huoty";
    char *name2 = name;

    // t1.name = name; // 错误，字符串数组只能用 strcpy
    strcpy(t2.name, name2);
    strcpy(t2.country, "China");
    t2.age = 30;

    cout << "name: " << t2.name << ", country: " << t2.country << endl;

    t1 = t2;
    cout << "name: " << t1.name << ", country: " << t1.country << endl;

    return 0;
}

